# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
pkgname=lua-schema
_rockname=$pkgname
_rockver=scm-1
_commit=e3e504df922da6175dbb055b091710ae46a44a14
pkgver=0_git20170304
pkgrel=0
pkgdesc="A simple package to check LUA-data against schemata"
url="https://github.com/sschoener/lua-schema"
arch="noarch"
license="MIT"
provides=
source="$url/archive/$_commit.zip"
builddir="$srcdir/$pkgname-$_commit"
options="!check"

_luaversions="5.2 5.3"
for _v in $_luaversions; do
	provides="$provides lua$_v-${pkgname#lua-}=$pkgver-r$pkgrel"
done

package() {
	local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_rockname/$_rockver"

	install -m 644 -D "$builddir"/schema.lua \
		"$pkgdir"/usr/share/lua/common/schema.lua

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="045c7c400aa69238109f21d79c6b3420081330c06189f8ba23efdbcad09680c7f017d33418dd61a5a4cd35953ecbeef511a62cdd850c65750d0b0a902e6009a4  e3e504df922da6175dbb055b091710ae46a44a14.zip"
